<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ServiceFinder (jersey-bundle 1.9 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ServiceFinder (jersey-bundle 1.9 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ServiceFinder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.DefaultServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/sun/jersey/spi/service/ServiceFinder.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ServiceFinder.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sun.jersey.spi.service</FONT>
<BR>
Class ServiceFinder&lt;T&gt;</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.jersey.spi.service.ServiceFinder&lt;T&gt;</B>
</PRE>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the service instance.</DL>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Iterable&lt;T&gt;</DD>
</DL>
<HR>
<DL>
<DT><PRE>public final class <B>ServiceFinder&lt;T&gt;</B><DT>extends java.lang.Object<DT>implements java.lang.Iterable&lt;T&gt;</DL>
</PRE>

<P>
A simple service-provider lookup mechanism.  A <i>service</i> is a
 well-known set of interfaces and (usually abstract) classes.  A <i>service
 provider</i> is a specific implementation of a service.  The classes in a
 provider typically implement the interfaces and subclass the classes defined
 in the service itself.  Service providers may be installed in an
 implementation of the Java platform in the form of extensions, that is, jar
 files placed into any of the usual extension directories.  Providers may
 also be made available by adding them to the applet or application class
 path or by some other platform-specific means.
 <p/>
 <p> In this lookup mechanism a service is represented by an interface or an
 abstract class.  (A concrete class may be used, but this is not
 recommended.)  A provider of a given service contains one or more concrete
 classes that extend this <i>service class</i> with data and code specific to
 the provider.  This <i>provider class</i> will typically not be the entire
 provider itself but rather a proxy that contains enough information to
 decide whether the provider is able to satisfy a particular request together
 with code that can create the actual provider on demand.  The details of
 provider classes tend to be highly service-specific; no single class or
 interface could possibly unify them, so no such class has been defined.  The
 only requirement enforced here is that provider classes must have a
 zero-argument constructor so that they may be instantiated during lookup.
 <p/>
 <p>The default service provider registration/lookup mechanism based
 on <tt>META-INF/services</tt> files is described below.
 For environments, where the basic mechanism is not suitable, clients
 can enforce a different approach by setting their custom <tt>ServiceIteratorProvider</tt>
 by calling <tt>setIteratorProvider</tt>. The call must be made prior to any lookup attempts.
 </p>
 <p> A service provider identifies itself by placing a provider-configuration
 file in the resource directory <tt>META-INF/services</tt>.  The file's name
 should consist of the fully-qualified name of the abstract service class.
 The file should contain a list of fully-qualified concrete provider-class
 names, one per line.  Space and tab characters surrounding each name, as
 well as blank lines, are ignored.  The comment character is <tt>'#'</tt>
 (<tt>0x23</tt>); on each line all characters following the first comment
 character are ignored.  The file must be encoded in UTF-8.
 <p/>
 <p> If a particular concrete provider class is named in more than one
 configuration file, or is named in the same configuration file more than
 once, then the duplicates will be ignored.  The configuration file naming a
 particular provider need not be in the same jar file or other distribution
 unit as the provider itself.  The provider must be accessible from the same
 class loader that was initially queried to locate the configuration file;
 note that this is not necessarily the class loader that found the file.
 <p/>
 <p> <b>Example:</b> Suppose we have a service class named
 <tt>java.io.spi.CharCodec</tt>.  It has two abstract methods:
 <p/>
 <pre>
   public abstract CharEncoder getEncoder(String encodingName);
   public abstract CharDecoder getDecoder(String encodingName);
 </pre>
 <p/>
 Each method returns an appropriate object or <tt>null</tt> if it cannot
 translate the given encoding.  Typical <tt>CharCodec</tt> providers will
 support more than one encoding.
 <p/>
 <p> If <tt>sun.io.StandardCodec</tt> is a provider of the <tt>CharCodec</tt>
 service then its jar file would contain the file
 <tt>META-INF/services/java.io.spi.CharCodec</tt>.  This file would contain
 the single line:
 <p/>
 <pre>
   sun.io.StandardCodec    # Standard codecs for the platform
 </pre>
 <p/>
 To locate an codec for a given encoding name, the internal I/O code would
 do something like this:
 <p/>
 <pre>
   CharEncoder getEncoder(String encodingName) {
       for( CharCodec cc : ServiceFinder.find(CharCodec.class) ) {
           CharEncoder ce = cc.getEncoder(encodingName);
           if (ce != null)
               return ce;
       }
       return null;
   }
 </pre>
 <p/>
 The provider-lookup mechanism always executes in the security context of the
 caller.  Trusted system code should typically invoke the methods in this
 class from within a privileged security context.
<P>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Mark Reinhold, Jakub Podlesak</DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.DefaultServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service">ServiceFinder.DefaultServiceIteratorProvider</A>&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.DefaultServiceIteratorProvider.html" title="type parameter in ServiceFinder.DefaultServiceIteratorProvider">T</A>&gt;</B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The default service iterator provider that looks up provider classes in
 META-INF/services files.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.ServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service">ServiceFinder.ServiceIteratorProvider</A>&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.ServiceIteratorProvider.html" title="type parameter in ServiceFinder.ServiceIteratorProvider">T</A>&gt;</B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Supports iteration of provider instances or classes.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class)">find</A></B>(java.lang.Class&lt;T&gt;&nbsp;service)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locates and incrementally instantiates the available providers of a
 given service using the context class loader.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class, boolean)">find</A></B>(java.lang.Class&lt;T&gt;&nbsp;service,
     boolean&nbsp;ignoreOnClassNotFound)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locates and incrementally instantiates the available providers of a
 given service using the context class loader.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class, java.lang.ClassLoader)">find</A></B>(java.lang.Class&lt;T&gt;&nbsp;service,
     java.lang.ClassLoader&nbsp;loader)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locates and incrementally instantiates the available providers of a
 given service using the given class loader.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class, java.lang.ClassLoader, boolean)">find</A></B>(java.lang.Class&lt;T&gt;&nbsp;service,
     java.lang.ClassLoader&nbsp;loader,
     boolean&nbsp;ignoreOnClassNotFound)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locates and incrementally instantiates the available providers of a
 given service using the given class loader.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;?&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.String)">find</A></B>(java.lang.String&nbsp;serviceName)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locates and incrementally instantiates the available classes of a given
 service file using the context class loader.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Iterator&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#iterator()">iterator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns discovered objects incrementally.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#setIteratorProvider(com.sun.jersey.spi.service.ServiceFinder.ServiceIteratorProvider)">setIteratorProvider</A></B>(<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.ServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service">ServiceFinder.ServiceIteratorProvider</A>&nbsp;sip)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Register the service iterator provider to iterate on provider instances
 or classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#toArray()">toArray</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns discovered objects all at once.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Class&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>&gt;[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#toClassArray()">toClassArray</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns discovered classes all at once.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="find(java.lang.Class, java.lang.ClassLoader)"><!-- --></A><H3>
find</H3>
<PRE>
public static &lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt; <B>find</B>(java.lang.Class&lt;T&gt;&nbsp;service,
                                        java.lang.ClassLoader&nbsp;loader)
                             throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Locates and incrementally instantiates the available providers of a
 given service using the given class loader.
 <p/>
 <p> This method transforms the name of the given service class into a
 provider-configuration filename as described above and then uses the
 <tt>getResources</tt> method of the given class loader to find all
 available files with that name.  These files are then read and parsed to
 produce a list of provider-class names.  The iterator that is returned
 uses the given class loader to lookup and then instantiate each element
 of the list.
 <p/>
 <p> Because it is possible for extensions to be installed into a running
 Java virtual machine, this method may return different results each time
 it is invoked. <p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the service instance.<DT><B>Parameters:</B><DD><CODE>service</CODE> - The service's abstract service class<DD><CODE>loader</CODE> - The class loader to be used to load provider-configuration files
                and instantiate provider classes, or <tt>null</tt> if the system
                class loader (or, failing that the bootstrap class loader) is to
                be used
<DT><B>Returns:</B><DD>the service finder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found and instantiated<DT><B>See Also:</B><DD><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class)"><CODE>find(Class)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="find(java.lang.Class, java.lang.ClassLoader, boolean)"><!-- --></A><H3>
find</H3>
<PRE>
public static &lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt; <B>find</B>(java.lang.Class&lt;T&gt;&nbsp;service,
                                        java.lang.ClassLoader&nbsp;loader,
                                        boolean&nbsp;ignoreOnClassNotFound)
                             throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Locates and incrementally instantiates the available providers of a
 given service using the given class loader.
 <p/>
 <p> This method transforms the name of the given service class into a
 provider-configuration filename as described above and then uses the
 <tt>getResources</tt> method of the given class loader to find all
 available files with that name.  These files are then read and parsed to
 produce a list of provider-class names.  The iterator that is returned
 uses the given class loader to lookup and then instantiate each element
 of the list.
 <p/>
 <p> Because it is possible for extensions to be installed into a running
 Java virtual machine, this method may return different results each time
 it is invoked. <p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the service instance.<DT><B>Parameters:</B><DD><CODE>service</CODE> - The service's abstract service class<DD><CODE>loader</CODE> - The class loader to be used to load provider-configuration files
                and instantiate provider classes, or <tt>null</tt> if the system
                class loader (or, failing that the bootstrap class loader) is to
                be used<DD><CODE>ignoreOnClassNotFound</CODE> - If a provider cannot be loaded by the class loader
                              then move on to the next available provider.
<DT><B>Returns:</B><DD>the service finder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found and instantiated<DT><B>See Also:</B><DD><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class)"><CODE>find(Class)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="find(java.lang.Class)"><!-- --></A><H3>
find</H3>
<PRE>
public static &lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt; <B>find</B>(java.lang.Class&lt;T&gt;&nbsp;service)
                             throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Locates and incrementally instantiates the available providers of a
 given service using the context class loader.  This convenience method
 is equivalent to
 <p/>
 <pre>
   ClassLoader cl = Thread.currentThread().getContextClassLoader();
   return Service.providers(service, cl, false);
 </pre>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the service instance.<DT><B>Parameters:</B><DD><CODE>service</CODE> - The service's abstract service class
<DT><B>Returns:</B><DD>the service finder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found and instantiated<DT><B>See Also:</B><DD><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class, java.lang.ClassLoader)"><CODE>find(Class, ClassLoader)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="find(java.lang.Class, boolean)"><!-- --></A><H3>
find</H3>
<PRE>
public static &lt;T&gt; <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;T&gt; <B>find</B>(java.lang.Class&lt;T&gt;&nbsp;service,
                                        boolean&nbsp;ignoreOnClassNotFound)
                             throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Locates and incrementally instantiates the available providers of a
 given service using the context class loader.  This convenience method
 is equivalent to
 <p/>
 <pre>
   ClassLoader cl = Thread.currentThread().getContextClassLoader();
   boolean ingore = ...
   return Service.providers(service, cl, ignore);
 </pre>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the service instance.<DT><B>Parameters:</B><DD><CODE>service</CODE> - The service's abstract service class<DD><CODE>ignoreOnClassNotFound</CODE> - If a provider cannot be loaded by the class loader
                              then move on to the next available provider.
<DT><B>Returns:</B><DD>the service finder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found and instantiated<DT><B>See Also:</B><DD><A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html#find(java.lang.Class, java.lang.ClassLoader)"><CODE>find(Class, ClassLoader)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="find(java.lang.String)"><!-- --></A><H3>
find</H3>
<PRE>
public static <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service">ServiceFinder</A>&lt;?&gt; <B>find</B>(java.lang.String&nbsp;serviceName)
                             throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Locates and incrementally instantiates the available classes of a given
 service file using the context class loader.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>serviceName</CODE> - the service name correspond to a file in
        META-INF/services that contains a list of fully qualified class
        names
<DT><B>Returns:</B><DD>the service finder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a service file violates the specified format
                                   or names a provider class that cannot be found and instantiated</DL>
</DD>
</DL>
<HR>

<A NAME="setIteratorProvider(com.sun.jersey.spi.service.ServiceFinder.ServiceIteratorProvider)"><!-- --></A><H3>
setIteratorProvider</H3>
<PRE>
public static void <B>setIteratorProvider</B>(<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.ServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service">ServiceFinder.ServiceIteratorProvider</A>&nbsp;sip)
                                throws java.lang.SecurityException</PRE>
<DL>
<DD>Register the service iterator provider to iterate on provider instances
 or classes.
 <p>
 The default implementation registered, <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.DefaultServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service"><CODE>ServiceFinder.DefaultServiceIteratorProvider</CODE></A>,
 looks up provider classes in META-INF/service files.
 <p>
 This method must be called prior to any attempts to obtain provider
 instances or classes.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sip</CODE> - the service iterator provider.
<DT><B>Throws:</B>
<DD><CODE>java.lang.SecurityException</CODE> - if the provider cannot be registered.</DL>
</DD>
</DL>
<HR>

<A NAME="iterator()"><!-- --></A><H3>
iterator</H3>
<PRE>
public java.util.Iterator&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>&gt; <B>iterator</B>()</PRE>
<DL>
<DD>Returns discovered objects incrementally.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>iterator</CODE> in interface <CODE>java.lang.Iterable&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>An <tt>Iterator</tt> that yields provider objects for the given
         service, in some arbitrary order.  The iterator will throw a
         <tt>ServiceConfigurationError</tt> if a provider-configuration
         file violates the specified format or if a provider class cannot
         be found and instantiated.</DL>
</DD>
</DL>
<HR>

<A NAME="toArray()"><!-- --></A><H3>
toArray</H3>
<PRE>
public <A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>[] <B>toArray</B>()
            throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Returns discovered objects all at once.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>can be empty but never null.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found and instantiated</DL>
</DD>
</DL>
<HR>

<A NAME="toClassArray()"><!-- --></A><H3>
toClassArray</H3>
<PRE>
public java.lang.Class&lt;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.html" title="type parameter in ServiceFinder">T</A>&gt;[] <B>toClassArray</B>()
                                  throws <A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></PRE>
<DL>
<DD>Returns discovered classes all at once.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>can be empty but never null.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service">ServiceConfigurationError</A></CODE> - If a provider-configuration file violates the specified format
                                   or names a provider class that cannot be found</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ServiceFinder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceConfigurationError.html" title="class in com.sun.jersey.spi.service"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/sun/jersey/spi/service/ServiceFinder.DefaultServiceIteratorProvider.html" title="class in com.sun.jersey.spi.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/sun/jersey/spi/service/ServiceFinder.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ServiceFinder.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2011 <a href="http://www.oracle.com/">Oracle Corporation</a>. All Rights Reserved.
</BODY>
</HTML>
